using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameHandle_Manager : MonoBehaviour
{
    public VirtualJoystickHandle_Ctrl move_VirtualHandle;
    public ImageHandle_Ctrl leftMove_Handle;
    public ImageHandle_Ctrl rightMove_Handle;
    public ImageHandle_Ctrl jump_Handle;
    public ImageHandle_Ctrl light_Handle;
    // Start is called before the first frame update
    void Start()
    {
        move_VirtualHandle.downEvent.AddListener(Player_Ctrl.instance.DownLeftJoystick);
        move_VirtualHandle.dragEvent.AddListener(Player_Ctrl.instance.DragLeftJoystick);
        move_VirtualHandle.upEvent.AddListener(Player_Ctrl.instance.UpLeftJoystick);
        leftMove_Handle.downOrEnterEvent.AddListener((e)=> { Player_Ctrl.instance.OnMoveDown(-1); });
        leftMove_Handle.upEvent.AddListener(() => { Player_Ctrl.instance.OnMoveUp(-1); });
        rightMove_Handle.downOrEnterEvent.AddListener((e) => { Player_Ctrl.instance.OnMoveDown(1); });
        rightMove_Handle.upEvent.AddListener(() => { Player_Ctrl.instance.OnMoveUp(1); });
        jump_Handle.downEvent.AddListener((e)=> { Player_Ctrl.instance.OnJump(); });
        light_Handle.downEvent.AddListener((e)=> { Player_Ctrl.instance.OnLight(); });
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
